<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="{$url_css}sweet-alert.css" />
    <script type="text/javascript" src="{$url_js}sweet-alert.min.js"></script>

</head>
<body>
    {if $type == 'error'}
        <script type="text/javascript">
            var url = '{$url}';
            {$target}.swal({
                title: "{$msg}",
                text: "{$desc}",
                type: "warning",
                // showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "{$button}",
                // cancelButtonText: "No, cancel plx!",
                closeOnConfirm: true,
                closeOnCancel: true
            },function(){
                if(url != ''){
                    self.location.href = "{$url}";
                }else{
                    self.history.go(-1);
                }
            });
        </script>
    {else}
        <script type="text/javascript">
            var url = '{$url}';
            {$target}.swal({
                title: "{$msg}",
                text: "{$desc}",
                type: "success",
                // showCancelButton: true,
                // confirmButtonColor: "#DD6B55",
                confirmButtonText: "{$button}",
                // cancelButtonText: "No, cancel plx!",
                closeOnConfirm: true,
                closeOnCancel: true
            },function(){
                if(url != ''){
                    self.location.href = "{$url}";
                }else{
                    self.history.go(-1);
                }
            });
        </script>
    {/if}
</body>
</html>